// 所有第三方服務的封裝
import req from './axios'
import {paths} from '../config'
let _router='';
import subCookieUtil from './util.cookie'

//登錄用戶信息
export const GetHeaderUserInfo = async () => {
    const token = subCookieUtil.getAllByName("token");
    return req.post(`${_router}${paths.outside._getHeaderUserInfo}`, {head: {auth: token}})
}
//獲取按鈕權限
export const GetAuthorizationByToken = async (data) => {
    const token = subCookieUtil.getAllByName("token");
    const param={head:{auth:token},data:data}
    return GetAuthorizationResource(param)
};
export const GetAuthorizationByUserID = async (uerid,data) => {
    const param={head:{code:uerid},data:data}
    return GetAuthorizationResource(param)
};

export const GetAuthorizationResource = async (data) => {
    return req.post(`${_router}${paths.outside._getAuthorizationResource}`, data)
};
